;; convert from clock to audio samples
(define clock->samples
(lambda (time)
(let* ((t1 (clock:clock))
(t2 (clock:ad:clock))
(t3 (round (+ (+ (car t2) (* (- time t1) *samplerate*))
(* (- t1 (cdr t2)) *samplerate*)))))
(real->integer t3))))